package com.wkbb.common.enums;

/**
 * @author luowenyan
 * @version V1.0
 * @className SwitchEnum
 * @description
 * @date 2019/7/26 18:02
 */
public enum SwitchEnum {

    /**
     * 开启
     */
    ON("ON","开启"),
    /**
     * 关闭
     */
    OFF("OFF","关闭");

    private SwitchEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private String value;

    private String desc;

    public String getValue() {
        return this.value;
    }

    public void setValue(String code) {
        this.value = value;
    }

    public String getDesc() {
        return this.desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDesc(String value) {
        for (SwitchEnum swt : SwitchEnum.values()) {
            if (swt.getValue().equals(value)) {
                return swt.getDesc();
            }
        }
        return null;
    }
}
